package day04;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/12
 */
//需求3：把一个数组元素逆序交换，int[] a ={5,11,15,24,36,47,59,66}; 交换元素后int[] a = {66,59,47,36,24,15,11,5}
    
public class TestOneArray03 {
    public static void main(String[] args) {
        int[] a = {5, 11, 15, 24, 36, 47, 59, 66};
        int length = a.length;
        for (int i = 0; i < length / 2; i++) {
            int temp = a[i];
            a[i] = a[length - 1 - i];
            a[length - 1 - i] = temp;
        }
        for (int num : a) {
            System.out.print(num + " ");
        }
    }
}
